package com.seres.data;

import java.util.List;

public class Scenario {
	private int scenarioId;
	private List<Answer> possibleAnswers;
	
//	private String fullDescription;
	private String shortDescription;
	private List<Description> descriptions;
	private List<SeresImage> images;
	private String question;
	
	Scenario(){
		
	}
//	public Scenario(String shortDescription, String fullDescription, List<Answer> possibleAnswers){
//		setShortDescription(shortDescription);
//		setFullDescription(fullDescription);
//		setPossibleAnswers(possibleAnswers);
//	}
	public Scenario(String shortDescription, List<Description> descriptions, List<Answer> possibleAnswers, List<SeresImage> images, String question){
		setShortDescription(shortDescription);
		setDescriptions(descriptions);
		setPossibleAnswers(possibleAnswers);
		setImages(images);
		setQuestion(question);
	}	
	public int getScenarioId() {
		return scenarioId;
	}

	public void setScenarioId(int scenarioId) {
		this.scenarioId = scenarioId;
	}
	public boolean hasAsPossibleAnswer(Answer answer){
		for(Answer possibleAnswer : getPossibleAnswers()){
			if(possibleAnswer.equals(answer)){
				return true;			
			}

		}
		return false;
	}

	public List<Answer> getPossibleAnswers() {
		return possibleAnswers;
	}

	public void setPossibleAnswers(List<Answer> possibleAnswers) {
		this.possibleAnswers = possibleAnswers;
	}
	
	public Answer getAnswer(int id){
		return getPossibleAnswers().get(id);
	}

//	public String getFullDescription() {
//		return fullDescription;
//	}
//
//	public void setFullDescription(String fullDescription) {
//		this.fullDescription = fullDescription;
//	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}
	public void setDescriptions(List<Description> descriptions) {
		this.descriptions = descriptions;
	}
	public List<Description> getDescriptions() {
		return descriptions;
	}
	public void setImages(List<SeresImage> images) {
		this.images = images;
	}
	public List<SeresImage> getImages() {
		return images;
	}
	public void setQuestion(String question) {
		this.question = question;
	}
	public String getQuestion() {
		return question;
	}
	public Answer getBestAnswer(Stakeholder stakeholder){
		float maxImpact = Float.MIN_VALUE;
		Answer bestAnswer = null;
		for(Answer answer : getPossibleAnswers()){
			if(answer.getStakeholderImpact(stakeholder).getValue() > maxImpact){
				bestAnswer = answer;
				maxImpact = answer.getStakeholderImpact(stakeholder).getValue();
			}
		}
		return bestAnswer;
	}

}
